export default {
	namespaced:true,
	
	state:()=>({
		token:'',
		userinfo:JSON.parse(uni.getStorageSync('userinfo') || '{}')
	}),
	
	mutations:{		
		updateUserInfo(state,userinfo){
			state.userinfo=userinfo
			
			this.commit('m_user/saveUserInfoToStorage')
		},
		saveUserInfoToStorage(state){
			uni.setStorageSync('userinfo',JSON.stringify(state.userinfo))
		}
	},
	
	getters:{}
}